<%--<%@ page import="zqdb.O_INFO" %>--%>
<%--<%@ page import="zqdb.T_TWO" %>--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>消费类别</title>
</head>
<body>
<div id="app">
    <nav class="breadcrumb" v-cloak>
        <i class="Hui-iconfont">&#xe67f;</i>首页
        <span class="c-gray en">&gt;</span> {{oneTitle}}
        <span class="c-gray en">&gt;</span> {{towTitle}}
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" @click="fRefresh()" title="刷新">
            <i class="Hui-iconfont">&#xe68f;</i>
        </a>
    </nav>
    <div class="page-container">
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <span class="l">
                <a href="javascript:" @click="fAdd" class="btn btn-primary radius" id="add"><i class="Hui-iconfont">&#xe600;</i> 新增</a>
            </span>
            <span class="r" style="padding-top: 5px; margin-right: 10px; margin-left: 10px">共有数据：[
                <strong id="count">{{iiCount}}</strong> 条]
            </span>
        </div>

        <table style="table-layout:fixed; width: 100%; word-break:break-all;" class="table table-border table-bordered table-bg table-hover table-sort table-responsive" id="tablelist">
            <thead>
            <tr class="text-c" style="height:0px;">
                <th style="width: 100px">流水号</th>
                <th style="width: 200px">名称</th>
                <th style="width: 300px">创建时间</th>
                <th>操作</th>
            </tr>

            </thead>
            <tbody id="datalist">
            <tr class='text-c' v-for="item in tableData" :key="item.VALUE01" v-cloak>
                <td> {{item.VALUE01}}</td>
                <td> {{item.VALUE02}}</td>
                <td> {{item.VALUE03}}</td>
                <td class='td-manage'>
                    <input class="btn btn-secondary-outline radius" type="button" value="编辑" @click="adminEdit('人员分类修改',item,'800','400', 0)">
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="static/axios.min.js"></script>
<script type="text/javascript" src="./static/vue"></script>

<script type="text/javascript">
    let vm = new Vue({
        el: '#app',
        data: {
            oneTitle: '人事管理',
            towTitle: '人员分类',
            iiCount: 0,
            tableData:[]
        },
        methods: {
            fAdd() {
                //--首先获取最大的编号，虽然获取的编号是个虚的
                let self = this
                let params = new URLSearchParams();
                params.append('CMD', "ZQ");
                params.append('VALUE01', "Z_RYFL");

                axios.post('/f_wscl/com2', params)
                    .then(function (res) {
                        let {db1} = res.data
                        self.adminEdit('人员分类新增', db1[0], '800', '400', 1)
                    })
                    .catch(function (error) {
                        layer.msg('网络异常错误', {icon: 1, time: 1000});
                    });
            },

            fRefresh() {
                this.fGetinfo();
            },

            fGetinfo() {
                let self = this
                let params = new URLSearchParams();
                params.append('CMD', "AF");

                axios.post('/f_wscl/com2', params)
                    .then(function (res) {
                        let {db1, db2} = res.data
                        self.tableData = db1
                        self.iiCount = db2[0].VALUE01
                    })
                    .catch(function (error) {
                        layer.msg('网络异常错误', {icon: 1, time: 1000});
                    });
            },

            /*编辑和新增*/
            //--   jud=0修改    jud=1新增
            adminEdit(title, obj, w, h, jud) {
                if (title == null || title === '') {
                    title = false;
                }
                if (w == null || w === '') {
                    w = 800;
                }
                if (h == null || h === '') {
                    h = ($(window).height() - 50);
                }
                let ls_opid = "${sessionOpid}";
                layer.open({
                    type: 2,
                    area: [w + 'px', h + 'px'],
                    fix: false, //不固定
                    maxmin: false,
                    shade: 0.4,
                    title: title,
                    content: ['w_zxkj_ryfledit.jsp', 'no'],
                    success: function (layero, index) {
                        let body = layer.getChildFrame('body', index);//少了这个是不能从父页面向子页面传值的
                        //获取子页面的元素，进行数据渲染
                        body.contents().find("#VALUE01").val(obj.VALUE01);
                        body.contents().find("#opid").val(ls_opid);
                        if (jud === 0) {
                            body.contents().find("#VALUE02").val(obj.VALUE02);
                        }
                    },
                });
            }
        },
        mounted() {
            window.fwGetinfo = this.fGetinfo;
        },
        created() {
            this.fGetinfo()
        }
    });

</script>
</body>
</html>
